using System;
using System.Collections.Generic;
using System.Text;

namespace demo_doan
{
    class DocGia : Interface
    {
        protected int madocgia;
        protected string hoten;
        protected int loaidocgia;
        protected DateTime ngaysinh;
        protected string diachi;
        protected string email;
        protected DateTime ngaylapthe;
        protected string manhanvien;
        protected DateTime ngayhethan;
        protected int tienno;

        public int TienNo
        {
            get { return tienno; }
            set { tienno = value; }
        }
	
        public DateTime NgayHetHan
        {
            get { return ngayhethan; }
            set { ngayhethan = value; }
        }
	
        public string MaNhanVien
        {
            get { return manhanvien; }
            set { manhanvien = value; }
        }
	
        public DateTime NgayLapThe
        {
            get { return ngaylapthe; }
            set { ngaylapthe = value; }
        }
	
        public int Email
        {
            get { return email; }
            set { email = value; }
        }
	
        public int DiaChi
        {
            get { return diachi; }
            set { diachi = value; }
        }
	
        public DateTime NgaySinh
        {
            get { return ngaysinh; }
            set { ngaysinh = value; }
        }
	
        public int LoaiDocGia
        {
            get { return loaidocgia; }
            set { loaidocgia = value; }
        }
	
        public string HoTen
        {
            get { return hoten; }
            set { hoten = value; }
        }
	
        public int MaDocGia
        {
            get { return madocgia; }
            set { madocgia = value; }
        }

        public DocGia() { }
        public DocGia(int mdg, string ht, int ldg, DateTime ns, string dc, string e, DateTime nlt, string mnv, DateTime nhh, int tn)
        {
            madocgia = mdg;
            hoten = ht;
            loaidocgia = ldg;
            ngaysinh = ns;
            diachi = dc;
            email = e;
            ngaylapthe = nlt;
            manhanvien = mnv;
            ngayhethan = nhh;
            tienno = tn;
        }
        public DocGia(DocGia dg)
        {
            madocgia = dg.MaDocGia;
            hoten = dg.HoTen;
            loaidocgia = dg.LoaiDocGia;
            ngaysinh = dg.NgaySinh;
            diachi = dg.DiaChi;
            email = dg.Email;
            ngaylapthe = dg.NgayLapThe;
            manhanvien = dg.MaNhanVien;
            ngayhethan = dg.NgayHetHan;
            tienno = dg.TienNo;
        }

        public override void Insert(string sql)
        {
            Provider prv = new Provider("server=TILOM8X-PC\\SQLEXPRESS; Database=QuanLyThuVien; Integrated security=true");
            prv.ExeQuery(sql);
        }
        public override void Update(string sql)
        {
            Provider prv = new Provider("server=TILOM8X-PC\\SQLEXPRESS; Database=QuanLyThuVien; Integrated security=true");
            prv.ExeQuery(sql);
        }
        public override void Delete(string sql)
        {
            Provider prv = new Provider("server=TILOM8X-PC\\SQLEXPRESS; Database=QuanLyThuVien; Integrated security=true");
            prv.ExeQuery(sql);
        }
        public override DataTable Select(string sql)
        {
            Provider prv = new Provider("server=TILOM8X-PC\\SQLEXPRESS; Database=QuanLyThuVien; Integrated security=true");
            return prv.ExecuteQuery(sql);
        }          
    }
}
